package Eyjafjalla.relic;

import Eyjafjalla.action.DrawToCloudAction;
import Eyjafjalla.helper.StringHelper;
import Eyjafjalla.patch.CloudFixPatch;
import basemod.abstracts.CustomRelic;
import com.megacrit.cardcrawl.actions.common.GainEnergyAction;
import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction;
import com.megacrit.cardcrawl.actions.utility.UseCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.relics.AbstractRelic;

public class GlassBird extends CustomRelic {

    public static final String ID = "eyjafjalla:GlassBird";

    public GlassBird(){
        super(ID, ImageMaster.loadImage(StringHelper.getRelicIMGPATH(ID,false)),ImageMaster.loadImage(StringHelper.getRelicIMGPATH(ID,true)),RelicTier.RARE,LandingSound.CLINK);
    }

    @Override
    public void onUseCard(AbstractCard targetCard, UseCardAction useCardAction) {
        if(targetCard.costForTurn>1){
            for(AbstractCard c:CloudFixPatch.glassedThisTurn){
                if(c.uuid.equals(targetCard.uuid))
                    return;
            }
            CloudFixPatch.glassedThisTurn.add(targetCard);
            this.flash();
            addToBot(new RelicAboveCreatureAction(AbstractDungeon.player,this));
            addToBot(new GainEnergyAction(1));
        }
    }

    @Override
    public String getUpdatedDescription() {
        return DESCRIPTIONS[0];
    }

    @Override
    public AbstractRelic makeCopy() {
        return new GlassBird();
    }
}



